export default {
  inserted(el, binding) {
    let input = el.getElementsByTagName("input")[0]
    let timeout
    input.addEventListener("keyup", e => {
      clearTimeout(timeout)
      timeout = setTimeout(() => {
        if (e.keyCode) {
          binding.value()
        }
      }, parseInt(binding.arg) || 300)
    })
  },
}
